function handleUserCach(id)
{
    var url=base+"/userCash/getUserCashInfo.do?id="+id;
    jQuery.layer({
        type: 2, 
        border: [0], 
        shadeClose: true,
        closeBtn: true,
        title: false,
        shadeClose: true,
        closeBtn: true,
        iframe: {src : url},
        area: ['452px' , '435px'] 
       }); 
}

function queryForm(pageIndex,pageSize)
{
     var url =base+"/reportMain/pagingInfo.do?pageIndex="+pageIndex+"&pageSize="+pageSize;
     var params =jQuery("#queryForm").serialize();
     params=decodeURIComponent(params,true); 
     jQuery("#reportContent").load(url+"&"+ encodeURI(encodeURI(params)),queryCashStatistics);
}



function gotoPage(pageSize)
{
   var pageIndex =jQuery("#pageIndex").val();
   queryForm(pageIndex,pageSize);
}

jQuery(function()
{
	 var startDateStr =DateUtil.dateToStr('yyyy-MM-dd');
	 jQuery("#queryForm input[name='startDate']").val(startDateStr+" 00:00:00");
	 queryForm(1,15);
     // jQuery("#customerFieldContent").load(base+"/customerFieldDefListDef.do");
}
); 


//查询提现记录的汇总记录
function queryCashStatistics()
{ 
	  var repCode=jQuery("#queryForm input[name='repCode']").val();
	  if(repCode=="pagingUserCash")
	  {
		  jQuery("#cashSummary").remove();
		  var rechargeTb = jQuery("#reportContentTb").children().length;
		  if(rechargeTb>0)
		  {
		  var params =jQuery("#queryForm").children().not("input[name='repCode']").serialize();
		  params=decodeURIComponent(params,true); 
		  jQuery.post(
		            base+"/reportMain/queryRepSummary.do?repCode=statisticsCashSummary&"+ encodeURI(encodeURI(params)), 
		            function(result){
		            	var data=eval("("+result+")");
		                var tr = jQuery("<tr style='height:22px;' id='cashSummary'/>");
		                jQuery("<td bgcolor='#FFFFFF' class='STYLE2' colspan='6'><div align='center' class='STYLE2 STYLE1'>汇总记录:</div></td>").appendTo(tr);
		                jQuery("<td bgcolor='#FFFFFF' class='STYLE2 STYLE1' align='center'>"+data.amount.toFixed(2)+"</div></td>").appendTo(tr); 
		                jQuery("<td bgcolor='#FFFFFF' class='STYLE2' align='center'>----</td>").appendTo(tr);
		                jQuery("<td bgcolor='#FFFFFF' class='STYLE2' align='center'>----</td>").appendTo(tr);
		                jQuery("<td bgcolor='#FFFFFF' class='STYLE2' align='center'>----</td>").appendTo(tr); 
	                    jQuery(tr).appendTo("#reportContentTb");
		            }); 
		  }
	  } 
}

function doUserCash()
{
         jQuery("#userCashForm").ajaxSubmit(
                  {
                  success:function(data){ 
                      var data=eval("("+data+")");
                      if(data.STATUS==0)
                       {
                         alert("保存成功!");
                         window.parent.queryForm(1,15); 
                         return closeWin() ;
                        }
                       alert(data.MSG);  
                   }
                 }
            );
}